Optimal. Leaf size=161 \[ \frac {(e+f x) \text {ArcTan}\left (e^{c+d x}\right )}{a d}-\frac {i f \text {PolyLog}\left (2,-i e^{c+d x}\right )}{2 a d^2}+\frac {i f \text {PolyLog}\left (2,i e^{c+d x}\right )}{2 a d^2}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 8, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {5690, 4270,
4265, 2317, 2438, 5559, 3852, 8} \begin {gather*} \frac {(e+f x) \text {ArcTan}\left (e^{c+d x}\right )}{a d}-\frac {i f \text {Li}_2\left (-i e^{c+d x}\right )}{2 a d^2}+\frac {i f \text {Li}_2\left (i e^{c+d x}\right )}{2 a d^2}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x) \tanh (c+d x) \text {sech}(c+d x)}{2 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2317
Rule 2438
Rule 3852
Rule 4265
Rule 4270
Rule 5559
Rule 5690
Rubi steps
\begin {align*} \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx &=-\frac {i \int (e+f x) \text {sech}^2(c+d x) \tanh (c+d x) \, dx}{a}+\frac {\int (e+f x) \text {sech}^3(c+d x) \, dx}{a}\\ &=\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {\int (e+f x) \text {sech}(c+d x) \, dx}{2 a}-\frac {(i f) \int \text {sech}^2(c+d x) \, dx}{2 a d}\\ &=\frac {(e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {f \text {Subst}(\int 1 \, dx,x,-i \tanh (c+d x))}{2 a d^2}-\frac {(i f) \int \log \left (1-i e^{c+d x}\right ) \, dx}{2 a d}+\frac {(i f) \int \log \left (1+i e^{c+d x}\right ) \, dx}{2 a d}\\ &=\frac {(e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}-\frac {(i f) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{c+d x}\right )}{2 a d^2}+\frac {(i f) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{c+d x}\right )}{2 a d^2}\\ &=\frac {(e+f x) \tan ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {i f \text {Li}_2\left (-i e^{c+d x}\right )}{2 a d^2}+\frac {i f \text {Li}_2\left (i e^{c+d x}\right )}{2 a d^2}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(710\) vs. \(2(161)=322\).
time = 2.21, size = 710, normalized size = 4.41 \begin {gather*} -\frac {-2 i d (e+f x)+(c+d x) (c f-d (2 e+f x)) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2+d e \left (c+d x-2 i \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )-i \sinh \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2-c f \left (c+d x-2 i \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )-i \sinh \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2+d e \left (c+d x+2 i \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2-c f \left (c+d x+2 i \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2+\frac {f \left (-2 (-1)^{3/4} (c+d x)^2+\sqrt {2} \left (2 (-2 i c+\pi -2 i d x) \log \left (1+i e^{-c-d x}\right )+\pi \left (3 c+3 d x-4 \log \left (1+e^{c+d x}\right )+4 \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )\right )-2 \log \left (-\sin \left (\frac {1}{4} (\pi -2 i (c+d x))\right )\right )\right )+4 i \text {PolyLog}\left (2,-i e^{-c-d x}\right )\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2}{2 \sqrt {2}}+\frac {f \left (2 \sqrt [4]{-1} (c+d x)^2+\sqrt {2} \left (2 (2 i c+\pi +2 i d x) \log \left (1-i e^{-c-d x}\right )-\pi \left (c+d x-4 \log \left (1+e^{c+d x}\right )+4 \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )\right )+2 \log \left (\sin \left (\frac {1}{4} (\pi +2 i (c+d x))\right )\right )\right )-4 i \text {PolyLog}\left (2,i e^{-c-d x}\right )\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2}{2 \sqrt {2}}-4 f \sinh \left (\frac {1}{2} (c+d x)\right ) \left (-i \cosh \left (\frac {1}{2} (c+d x)\right )+\sinh \left (\frac {1}{2} (c+d x)\right )\right )}{4 d^2 (a+i a \sinh (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 4.04, size = 268, normalized size = 1.66
method | result | size |
risch | \(\frac {d f x \,{\mathrm e}^{d x +c}+d e \,{\mathrm e}^{d x +c}+f \,{\mathrm e}^{d x +c}-i f}{\left ({\mathrm e}^{d x +c}-i\right )^{2} d^{2} a}+\frac {i e \ln \left ({\mathrm e}^{d x +c}+i\right )}{2 d a}-\frac {i e \ln \left ({\mathrm e}^{d x +c}-i\right )}{2 d a}+\frac {i f \ln \left (1-i {\mathrm e}^{d x +c}\right ) x}{2 d a}+\frac {i f \ln \left (1-i {\mathrm e}^{d x +c}\right ) c}{2 d^{2} a}+\frac {i f \polylog \left (2, i {\mathrm e}^{d x +c}\right )}{2 a \,d^{2}}-\frac {i f \ln \left (1+i {\mathrm e}^{d x +c}\right ) x}{2 d a}-\frac {i f \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{2 d^{2} a}-\frac {i f \polylog \left (2, -i {\mathrm e}^{d x +c}\right )}{2 a \,d^{2}}-\frac {i f c \ln \left ({\mathrm e}^{d x +c}+i\right )}{2 d^{2} a}+\frac {i f c \ln \left ({\mathrm e}^{d x +c}-i\right )}{2 d^{2} a}\) | \(268\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 359 vs. \(2 (138) = 276\).
time = 0.40, size = 359, normalized size = 2.23 \begin {gather*} \frac {{\left (i \, f e^{\left (2 \, d x + 2 \, c\right )} + 2 \, f e^{\left (d x + c\right )} - i \, f\right )} {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right ) + {\left (-i \, f e^{\left (2 \, d x + 2 \, c\right )} - 2 \, f e^{\left (d x + c\right )} + i \, f\right )} {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) + 2 \, {\left (d f x + d e + f\right )} e^{\left (d x + c\right )} + {\left (i \, c f - i \, d e + {\left (-i \, c f + i \, d e\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (c f - d e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + i\right ) + {\left (-i \, c f + i \, d e + {\left (i \, c f - i \, d e\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (c f - d e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + {\left (i \, d f x + i \, c f + {\left (-i \, d f x - i \, c f\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (d f x + c f\right )} e^{\left (d x + c\right )}\right )} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\left (-i \, d f x - i \, c f + {\left (i \, d f x + i \, c f\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d f x + c f\right )} e^{\left (d x + c\right )}\right )} \log \left (-i \, e^{\left (d x + c\right )} + 1\right ) - 2 i \, f}{2 \, {\left (a d^{2} e^{\left (2 \, d x + 2 \, c\right )} - 2 i \, a d^{2} e^{\left (d x + c\right )} - a d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {e \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f x \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {e+f\,x}{\mathrm {cosh}\left (c+d\,x\right )\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________